//package com.wuzhiaite.javaweb.base.config.es;
//
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.data.elasticsearch.client.ClientConfiguration;
//import org.springframework.data.elasticsearch.client.reactive.DefaultReactiveElasticsearchClient;
//import org.springframework.data.elasticsearch.client.reactive.ReactiveElasticsearchClient;
//import org.springframework.data.elasticsearch.config.AbstractReactiveElasticsearchConfiguration;
//import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations;
//import org.springframework.data.elasticsearch.core.ReactiveElasticsearchTemplate;
//import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter;
//import org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter;
//import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext;
//import org.springframework.data.elasticsearch.repository.config.EnableReactiveElasticsearchRepositories;
//
///**
// * reactiveElasticsearch 配置
// * @author lpf
// */
//@Configuration
//@EnableReactiveElasticsearchRepositories
//public class ReactiveElasticsearchConfig extends AbstractReactiveElasticsearchConfiguration {
//
//    @Value("${es.hostAndPort}")
//    private String hostAndport;
//
//    /**
//     * 配置要使用的客户端。
//     * @return
//     */
//    @Override
//    @Bean
//    public ReactiveElasticsearchClient reactiveElasticsearchClient() {
//        final ClientConfiguration clientConfiguration = ClientConfiguration.builder()
//                .connectedTo(hostAndport)
//                .build();
//        return DefaultReactiveElasticsearchClient.create(clientConfiguration);
//    }
//
//
//    @Override
//    @Bean
//    public ElasticsearchConverter elasticsearchConverter() {
//        return new MappingElasticsearchConverter(elasticsearchMappingContext());
//    }
//    @Override
//    @Bean
//    public SimpleElasticsearchMappingContext elasticsearchMappingContext() {
//        return new SimpleElasticsearchMappingContext();
//    }
//    @Bean
//    public ReactiveElasticsearchOperations reactiveElasticsearchOperations() {
//        return new ReactiveElasticsearchTemplate(reactiveElasticsearchClient(), elasticsearchConverter());
//    }
//
//
//
//
//}
